
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增生产（育苗）阶段')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-ncStage-add" th:object="${ncStandard}">
        <input id="standardId" name="standardId" th:field="*{standardId}" type="hidden">
        <input id="stageDetail" name="stageDetail"  type="hidden">

        <div class="form-group">
            <label class="col-sm-3 control-label">阶段名称：</label>
            <div class="col-sm-8">
                <input id="stageName" name="stageName" required class="form-control"
                       type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">阶段天数：</label>
            <div class="col-sm-8">
                <input id="stageDays" required name="stageDays" class="form-control" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">排序号：</label>
            <div class="col-sm-8">
                <input id="orderNum" required name="orderNum" class="form-control" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">阶段描述：</label>
        </div>

        <div class="form-group">
            <div id="editor" type="text/plain" style="width:1024px;height:500px;"></div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" charset="utf-8" th:src="@{/ueditor/ueditor.config.js}"></script>
<script type="text/javascript" charset="utf-8" th:src="@{/ueditor/ueditor.all.js}"></script>

<script type="text/javascript">
    var prefix = ctx + "system/ncStage"
    $("#form-ncStage-add").validate({
        rules: {
            stageDays: {
                required: true,
                number:true,
                digits:true,
                min:0
            },
            orderNum: {
                required: true,
                number:true,
                digits:true,
                min:0
            },
            stageName:{
                required: true,
            }
        },
        messages: {
            stageDays: {
                required: "请输入阶段天数",
                digits:"请输入正整数"
            },
            orderNum: {
                required: "请输入阶段天数",
                digits:"请输入正整数"
            }
        },
        focusCleanup: true
    });

    function submitHandler() {
        $('#stageDetail').val(ue.getContent());
        if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-ncStage-add').serialize());
         }
    }


    var ue = UE.getEditor('editor', {
        initialFrameWidth: 755,
        initialFrameHeight: 600
    });
</script>
</body>
</html>
